package cn.mafangui.hotel.service.impl;

import cn.mafangui.hotel.entity.Notice;
import cn.mafangui.hotel.entity.Order;
import cn.mafangui.hotel.enums.OrderStatus;
import cn.mafangui.hotel.mapper.NoticeMapper;
import cn.mafangui.hotel.mapper.OrderMapper;
import cn.mafangui.hotel.service.NoticeService;
import cn.mafangui.hotel.service.OrderService;
import cn.mafangui.hotel.service.RoomService;
import cn.mafangui.hotel.service.RoomTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;

import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {

    @Autowired
    private NoticeMapper noticeMapper;

    @Override
    public int insert(Notice notice) {
        return noticeMapper.insert(notice);
    }

    @Override
    public int delete(Integer id) {
        return noticeMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Notice selectById(Integer id) {
        return noticeMapper.selectByPrimaryKey(id);
    }

    @Override
    public int update(Notice record) {
        return noticeMapper.updateByPrimaryKey(record);
    }

    @Override
    public Integer getNoticeCount() {
        return noticeMapper.getNoticeCount();
    }

    @Override
    public List<Notice> selectByUserId(int userId) {
        return noticeMapper.selectByUserId(userId);
    }

    @Override
    public List<Notice> AllNotices() {
        return noticeMapper.selectAll();
    }

}
